import { OrganizationTree } from './../../../../../models/organization';
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';

@Component({
  selector: 'zepride-topbar',
  templateUrl: './topbar.component.html',
  styleUrls: ['./topbar.component.less']
})
export class TopbarComponent implements OnInit {
  // private _orgNodes: OrganizationTree[] = [];
  // @Input() set orgNodes(value) {
  //   this._orgNodes = value;
  //   if (this._orgNodes.length) {
  //     this.curItem = this._orgNodes[0];
  //     this.treeNodeChanged.emit(this._orgNodes[0]);
  //   }
  // };
  // get orgNodes() {
  //   return this._orgNodes;
  // }

  @Input() departmentNode: OrganizationTree;
  @Input() employeeNodes: OrganizationTree[] = [];
  // curItem: OrganizationTree;

  @Output() treeNodeChanged = new EventEmitter<any>();
  constructor() { }

  ngOnInit(): void {
    // this.treeNodeChanged.emit(this.departmentNode);
    console.log(this.departmentNode, this.employeeNodes);
  }

  // tabChange(item) {
  //   this.curItem = item;
  //   this.treeNodeChanged.emit(item);
  // }

}
